#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <arpa/inet.h>
#include <sys/socket.h>

#define BUFSIZE 512
#define STRING1 "aaaaaa"
#define STRING2 "BBBBBB"
#define STRING3 "cccccc"

int main(int argc, char *argv[]) {
    if (argc != 3) {
        printf("Usage [%s]: %s IP port\n", argv[0], argv[0]);
        return 0;
    }
    struct sockaddr_in addr;
    int fd = socket(PF_INET, SOCK_DGRAM, 0);
    assert(fd != -1);
    
    int rc;
    addr.sin_family = AF_INET;
    addr.sin_addr.s_addr = inet_addr(argv[1]);
    addr.sin_port = htons(atoi(argv[2]));
    
    char buf1[] = STRING1;
    rc = sendto(fd, buf1, sizeof buf1, 0, (struct sockaddr *)&addr, sizeof(addr));
    assert(rc != -1);

    char buf2[] = STRING2;
    rc = sendto(fd, buf2, sizeof buf2, 0, (struct sockaddr *)&addr, sizeof(addr));
    assert(rc != -1);

    char buf3[] = STRING3;
    rc = sendto(fd, buf3, sizeof buf3, 0, (struct sockaddr *)&addr, sizeof(addr));
    assert(rc != -1);
    
    return 0;
}